﻿<%@ Page Language="C#" Theme="WebMaster" MasterPageFile="~/WebMaster/MasterPage.master"
    AutoEventWireup="true" Inherits="SouthernLand.WebMaster.Articles.Default" CodeBehind="Default.aspx.cs" %>

<%@ Register Src="~/WebMaster/Controls/Title.ascx" TagName="Title" TagPrefix="uc" %>
<%@ Register TagPrefix="southern" Namespace="SouthernLand.Common.BOL.Articles" Assembly="SouthernLand"%>
<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" runat="Server">
    <uc:Title runat="server" ResourceKey='Article_Manager' />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <table align="center" width="700" cellpadding="0" cellspacing="0" border="0" style="table-layout: fixed">
                <tr>
                    <td>
                        <table width="700" align="center" cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td align="left">
                                    <a class="linkAdd" href="<%=Globals.ApplicationPath %>WebMaster/Articles/ArticleAddEdit.aspx">
                                        <%=ResourceManager.GetString("Article_Add") %></a>
                                </td>
                                <td align="right">
                                    <span class="text">Search:</span>
                                    <southern:ddlArticleCategory runat="server" ID="dlArticleCategory" CssClass="Textbox" />
                                    <asp:TextBox runat="server" CssClass="textbox" ID="txtKeyword" Text=""></asp:TextBox>
                                    <asp:Button runat="server" ID="btSearch" OnClick="btSearch_Click" Text="Search" CssClass="Textbox" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td align="center" style="padding-top: 10px;">
                        <asp:GridView runat="server" Width="700" ID="GridViewItem" DataSourceID="ItemDataSource"
                            AutoGenerateColumns="false" AllowPaging="True" AllowSorting="True" PagerSettings-Mode="NumericFirstLast"
                            PageSize="25">
                            <Columns>
                                <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px"
                                    HeaderText="Delete">
                                    <HeaderTemplate>
                                        <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);" runat="server"
                                            type="checkbox" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox runat="server" ID="chkSelect" ToolTip='<%# Eval("ArticleID") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Title" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left">
                                    <HeaderTemplate>
                                        <%=ResourceManager.GetString("Title") %></HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="ArticleAddEdit.aspx?ArticleID=<%# Eval("ArticleID") %>&CateID=<%# Eval("ArticleCateID")%>&Action=Edit">
                                            <%# Eval("Title") %></a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-Width="60" ItemStyle-Width="60" HeaderStyle-HorizontalAlign="center"
                                    ItemStyle-HorizontalAlign="center">
                                    <HeaderTemplate>
                                        <%=ResourceManager.GetString("Lanxem") %></HeaderTemplate>
                                    <ItemTemplate>
                                        <%#Eval("Totalviews") %></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-Width="80" ItemStyle-Width="80" HeaderStyle-HorizontalAlign="center"
                                    ItemStyle-HorizontalAlign="center">
                                    <HeaderTemplate>
                                        Ngày</HeaderTemplate>
                                    <ItemTemplate>
                                        <%# Formatter.FormatDate((DateTime)Eval("PostDate")) %></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-Width="80" ItemStyle-Width="80" HeaderStyle-HorizontalAlign="center"
                                    ItemStyle-HorizontalAlign="center">
                                    <HeaderTemplate>
                                        Ưu tiên</HeaderTemplate>
                                    <ItemTemplate>
                                        <%#(int)Eval("Priority") == 1 ? "<font color=red>Yes</font>" : "No"%></ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField ItemStyle-Width="40px" HeaderStyle-Width="40px">
                                    <HeaderTemplate>
                                        <%=ResourceManager.GetString("Edit") %></HeaderTemplate>
                                    <ItemTemplate>
                                        <a href="ArticleAddEdit.aspx?ArticleID=<%# Eval("ArticleID") %>&CateID=<%# Eval("ArticleCateID")%>&Action=Edit">
                                            <img src="<%=Globals.ImagesUrlWebMaster() %>Edit.gif" border="0" />
                                        </a>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EmptyDataTemplate>
                                <table align="center" width="300" border="0" bordercolorlight="#0099cc" bordercolor="#0099cc">
                                    <tr>
                                        <td height="50" align="center">
                                            <div align="center" id="EmptyData">
                                                Data Empty...</div>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <br />
                        <asp:Button runat="server" ID="btDelete" Text=" Delete " OnClick="btDelete_Click" /><br />
                        <br />
                        <br />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="SearchDataSource" runat="server" SelectMethod="Search"
        TypeName="SouthernLand.Common.BOL.Articles.Article">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtKeyword" Name="Keyword" PropertyName="Text" Type="string"
                DefaultValue=" " />
            <asp:ControlParameter ControlID="dlArticleCategory" Name="CateID" PropertyName="SelectedValue"
                Type="int32" DefaultValue="1" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ItemDataSource" runat="server" SelectMethod="GetAllArticle"
        TypeName="SouthernLand.Common.BOL.Articles.Article"></asp:ObjectDataSource>
</asp:Content>
